﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace LuceneNetServices.Models
{
    public class LogCfg
    {
        /// <summary>
        /// 失败后重试次数
        /// </summary>
        public static int RefireCount
        {
            get
            {
                string m_strRefireCount = ConfigurationManager.AppSettings["RefireCount"];
                if (string.IsNullOrEmpty(m_strRefireCount))
                    m_strRefireCount = "0";
                int m_iSelectMax = 0;
                int.TryParse(m_strRefireCount, out m_iSelectMax);
                return m_iSelectMax;
            }
        }

        /// <summary>
        /// 日志存放时间,默认是7天
        /// </summary>
        public static double LogNDays
        {
            get
            {
                double m_dblLogNDays = 7;
                string m_strLogNDays = ConfigurationManager.AppSettings["LogNDays"];
                double.TryParse(m_strLogNDays, out m_dblLogNDays);

                return m_dblLogNDays;
            }
        }

        public static string LogPath
        {
            get
            {
                return ConfigurationManager.AppSettings["LogPath"];
            }
        }

        public static string ExtendName
        {
            get
            {
                return ConfigurationManager.AppSettings["ExtendName"];
            }
        }
    }
}
